package com.ibm.cps.implementations;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ibm.cps.message.ParsedDataMessage;

public class MessageToMQ {
	private String tenantid;
	private String topicName;
	private ParsedDataMessage parsedDataMessage;
	private String ruleName;

	public MessageToMQ(String tenantid, String topicName,
			ParsedDataMessage parsedMessage, String ruleName) {
		this.tenantid = tenantid;
		this.topicName = topicName;
		this.parsedDataMessage = parsedMessage;
		this.ruleName = ruleName;
	}

	public String getTenantid() {
		return tenantid;
	}

	public String getTopicName() {
		return topicName;
	}

	public byte[] getMessage() {
		ObjectNode objectNode = null;
		// (ObjectNode)
		// JSONUtility.fromString(parsedDataMessage.getJsonMessage());
		objectNode.put("hit", ruleName);
		return objectNode.toString().getBytes();
	}

	/*
	 * @Deprecated public String getParsedDataMessage(JsonSchema schema) { try {
	 * ObjectNode objectNode = (ObjectNode) JSONUtility
	 * .fromString(parsedDataMessage.getReturnedMessage(schema));
	 * objectNode.put("hit", ruleName); return objectNode.toString(); } catch
	 * (CPSException e) { e.printStackTrace(); } return null; }
	 */
}
